#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 合并得到的url文件

import datetime

try:
    url_regular = open("E:\Hosts\\xuanwulab\\twitter\\url_from_regular.txt", "r").read().split('\n')
    url_short = open("E:\Hosts\\xuanwulab\\twitter\\url_from_short.txt", "r").read().split('\n')

    urllist = url_short + url_regular
    for i in urllist:
        if '' in urllist:
            urllist.remove('')

    now = datetime.datetime.now()
    file = open('E:\Hosts\\xuanwulab\\twitter\\url_' + now.strftime('%Y%m%d%H%M') + '.txt', 'w')
    for u in urllist:
        file.write(u + '\n')
    file.close()

except Exception as e:
    print(e)